package com.own.business.level.common.swagger;

import com.own.component.swagger.BaseSwaggerConfiguration;
import com.own.component.swagger.SwaggerSecurity;
import com.own.constant.ConstantEnvironmentType;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Profile;
import springfox.documentation.oas.annotations.EnableOpenApi;
import springfox.documentation.spring.web.plugins.Docket;

import javax.annotation.Resource;

/**
 * SwaggerConfiguration swagger文档配置
 *
 * @author 陈学礼
 * @version 4.0.0
 * @date 2021-6-17 17:04:29
 * @since 4.0.0
 */
@Profile({ConstantEnvironmentType.DEV, ConstantEnvironmentType.TEST})
@EnableOpenApi
@SpringBootConfiguration
public class LevelSwaggerConfig extends BaseSwaggerConfiguration {

    @Resource
    private SwaggerSecurity swaggerSecurity;

    @Bean
    public Docket levelBusinessApi() {
        return swaggerSecurity.security(new LevelSwaggerFunction().api());
    }

}
